{include file="$tpl_dir./errors.tpl"}
<script type="text/javascript">
// Load the getForm function while page is loading
window.onload = getForm;

//Set this to your validation PHP script, default is "validate.php?value="
var vUrl = "{$img_dir}../process/validate.php?value=";

//Set this to your form's id
var formid = "vform";

var vblank = "{$img_dir}blank.gif";
var vtrue = "{$img_dir}true.png";
var vfalse = "{$img_dir}false.png";
var vcustomer = "{$customer}";
	
</script>
<form id="vform" action="{$link->getPageLink('my-account.php', true)}" method="post" class="std">
	<fieldset>
		<h3>{l s='Thông tin.'}</h3>
		{if isset($confirmation) && $confirmation}
			<p class="success">
				{l s='Bạn đã cập nhật thành công!'}
			</p>
		{/if}
		<div class="fieldset-left">
			<p class="password required">
				<label for="passwd">{l s='Mật khẩu hiện tại'}</label>
				<input type="password" class="required account text" name="old_passwd" id="old_passwd" />
				<sup>*</sup>
				<img width="16" height="16" name="old_passwd" src="img/blank.gif" alt="" />
			</p>
			<p class="password required">
				<label for="passwd">{l s='Mật khẩu mới'}</label>
				<input type="password" class="text" name="passwd" id="passwd" />
				<sup></sup>
			</p>
			<p class="text required">
				<label for="email">{l s='Email'}</label>
				<input type="text" class="required email text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email|escape:'htmlall':'UTF-8'|stripslashes}{/if}" />
				<sup>*</sup>
				<img width="16" height="16" name="email" src="img/blank.gif" alt="" />
			</p>
		</div>
		<div class="fieldset-right" style="margin-right: 60px;">
			{if isset($confAddPoint) && $confAddPoint==1}
				<p class="success">
					{l s='Bạn đã nhận được '}{$cpoints}{l s=' điểm !'}
				</p>
			{elseif isset($confAddPoint) && $confAddPoint==2}
				<p class="error" style="">{l s='Mã '}<B>{$codepoints}</B> {l s=' của bạn không đúng !'}</p>
			{elseif isset($confAddPoint) && $confAddPoint==3}
				<p class="error" style="">{l s='Bạn đã nhận mã này !'}</p>
			{elseif isset($confAddPoint) && $confAddPoint==4}
				<p class="error" style="">{l s='Mã của bạn đã hết hạn !'}</p>
			{else}
				<p style="height:20px;"></p>
			{/if}
			<p class="text required">
				
				<input type="text" id="receipt_point" class="receipt_point text" name="receipt_point" value="" />
				<span class="span-submit">
					<input type="submit" id="SubmitLogin" name="SubmitCodePoints" class="button" value="" />
				</span>
			</p>
			<p class="notifi">{l s='Mã nhận điểm tặng !'}</p>
			
		</div>
		{if isset($confirmation) && $confirmation}
			<div class="clear" style="height: 10px;" ></div>
		{else}
			<div class="clear" style="height:40px;" ></div>
		{/if}
		<div class="fieldset-left">
			<p class="text required">
				<label for="name">{l s='Họ và tên'}</label>
				<input type="text" class="required name text" id="name" name="name" value="{if isset($smarty.post.name)}{$smarty.post.name}{/if}" />
				<sup>*</sup>
				<img width="16" height="16" name="name" src="img/blank.gif" alt="">
			</p>
			<p class="text required">
				<label for="address">{l s='Địa chỉ'}</label>
				<input type="text" class="required name text" id="address" name="address" value="{if isset($smarty.post.address)}{$smarty.post.address}{/if}" />
				<sup>*</sup>
				<img width="16" height="16" name="address" src="img/blank.gif" alt="">
			</p>
			<p class="text">
				<label for="city">{l s='Tỉnh / Thành phố'}</label>
				<select id="city" name="city">
					<option value="">---{l s='Tỉnh / Thành phố'}---</option>
					{foreach from=$city item=item}
						<option value="{$item}" {if isset($smarty.post.city) && $smarty.post.city == $item} selected="selected" {/if} >&nbsp;{l s="$item"}&nbsp;</option>
					{/foreach}
				</select>
			</p>
		</div>
		<div class="fieldset-right" style="margin-right: 30px;">
			<p class="text required">
				<label for="phone">{l s='Điện thoại/ Mobile'}</label>
				<input type="text" class="required number text" id="phone" name="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />
				<sup>*</sup>
				<img width="16" height="16" name="phone" src="img/blank.gif" alt="">
			</p>
			<p class="select">
				<label>{l s='Ngày sinh'}</label>
				<select id="days" name="days">
					<option value="">-</option>
					{foreach from=$days item=day}
						<option value="{$day|escape:'htmlall':'UTF-8'}" {if ($sl_day == $day)} selected="selected"{/if}>{$day|escape:'htmlall':'UTF-8'}&nbsp;&nbsp;</option>
					{/foreach}
				</select>
				<select id="months" name="months">
					<option value="">-</option>
					{foreach from=$months key=k item=month}
						<option value="{$k|escape:'htmlall':'UTF-8'}" {if ($sl_month == $k)} selected="selected"{/if}>{l s="$month"}&nbsp;</option>
					{/foreach}
				</select>
				<select id="years" name="years">
					<option value="">-</option>
					{foreach from=$years item=year}
						<option value="{$year|escape:'htmlall':'UTF-8'}" {if ($sl_year == $year)} selected="selected"{/if}>{$year|escape:'htmlall':'UTF-8'}&nbsp;&nbsp;</option>
					{/foreach}
				</select>
			</p>
			<p class="text">
				<label for="code">{l s='Điểm thành viên'}</label>
				<input type="text" class="text" id="point" name="point" value="{$points}" disabled="disabled" />
				<input type="hidden" class="text" id="parent" name="parent" value="{if isset($smarty.post.parent)}{$smarty.post.parent}{/if}" />
				<input type="hidden" class="text" id="code" name="code" value="{if isset($smarty.post.code)}{$smarty.post.code}{/if}" />
			</p>
			
		</div>
		<div class="clear"></div>
		
		<p class="submit">
			<input type="submit" id="submit" name="submitIdentity" value="{l s='Cập nhật'}"  class="exclusive" />
		</p>
	</fieldset>
</form>
